Skip to content

fix: show clear error when project directory is missing#1008

Draft
chuks-qua wants to merge 8 commits intopingdotgg:mainfrom
chuks-qua:fix/975-missing-project-directory
Draft

fix: show clear error when project directory is missing#1008
chuks-qua wants to merge 8 commits intopingdotgg:mainfrom
chuks-qua:fix/975-missing-project-directory

Conversation

@chuks-qua
Copy link
Contributor

@chuks-qua chuks-qua commented Mar 13, 2026

What Changed

When a project folder is deleted or moved, the app now shows a clear "Project directory does not exist" error instead of the misleading "Codex CLI (codex) is not installed or not executable" message. The composer is disabled, sidebar threads show strikethrough styling, and everything auto-recovers when the folder is restored.

Why

Fixes #975. When a project directory no longer exists, spawnSync("codex", ["--version"], { cwd: deletedPath }) fails with ENOENT. The existing code assumed ENOENT always meant the binary was missing, producing a confusing error. Users had no way to understand the actual problem or recover from it.

Key Changes

  • Server: Disambiguate ENOENT in assertSupportedCodexCliVersion by checking existsSync(input.cwd) in the error path (zero cost in happy path)
  • WS endpoint: New projects.checkDirectories method that stats project cwds in parallel via Effect.forEach
  • React hook: useProjectDirectoryCheck checks directories on mount and window focus (debounced 500ms), using shallow-compared cwd selectors to avoid unnecessary re-checks
  • Sidebar: Threads under missing projects show line-through text-destructive/60 strikethrough
  • ChatView: Non-dismissible error banner, disabled composer with helpful placeholder, blocked sending. All auto-clear when directory is restored.

UI Changes

Before

After

Sidebar (strikethrough on threads with missing directory):

Chat view (error banner + disabled composer):

Recovery (after restoring the folder and focusing the window):

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Show clear error in chat UI when a project directory is missing

  • Adds a projects.checkDirectories WebSocket RPC method (ws.ts, wsServer.ts) that accepts a list of paths and returns which ones are missing or not directories.
  • A new useProjectDirectoryCheck hook polls on mount, on project change, and on window focus, storing results in a new missingProjectCwds set in the app store.
  • When a project directory is missing, ChatView disables the composer, shows a non-dismissible error banner, and blocks message sending.
  • Thread titles in the Sidebar render with line-through and destructive color for missing directories.
  • assertSupportedCodexCliVersion now distinguishes between a missing CLI binary and a missing project directory when ENOENT is returned.

Macroscope summarized 17f3f5a.

@github-actions github-actions bot added the size:L 100-499 changed lines (additions + deletions). label Mar 13, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4aaa707b-cc05-477c-9ecc-9c86dd274449

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.

OpenGrep is compatible with Semgrep configurations. Add an opengrep.yml or semgrep.yml configuration file to your project to enable OpenGrep analysis.

@github-actions github-actions bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] error message 'Codex CLI (codex) is not installed or not executable' when project folder no longer exists or has been moved

1 participant